home *** CD-ROM | disk | FTP | other *** search
- Path: user2.mnsinc.com!huang
- From: huang@mnsinc.com (Szu-Wen Huang)
- Newsgroups: comp.lang.c
- Subject: Re: #define "creating" strings ?
- Date: 14 Mar 1996 22:23:10 GMT
- Organization: Monumental Network Systems
- Message-ID: <4ia68f$c5r@news1.mnsinc.com>
- References: <Do9tsI.H2t@undergrad.math.uwaterloo.ca>
- NNTP-Posting-Host: user2.mnsinc.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Chris Palmer (crpalmer@solo.uwaterloo.ca) wrote:
- : I have a problem that I would like to solve using a "feature" of the C
- : preprocessor that until now I've never seen or heard of. A book that we have
- : here gives the example:
-
- : #define MAKESTRING(x) "x"
-
- : which does in fact produce strings that have the value of x substituted.
- : [eg: MAKESTRING(foo) gets processed into "foo"].
-
- More interestingly, why would anybody want to define a macro like that?
- I tried thinking about it, but I can't convince myself that it's useful.
- Thoughts?
-